/**
 *销售信息维护
 */
import axios from '@/api/fetch';
import SERVER from '@/api/server';

// 获取列表
export const getSaleInfoMaintain = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/dealerSaleInfo/getSaleInfoMaintain`, {params});
// 删除
export const deleteAuthorizedBrand = (orgRelationId) => axios.delete(`${SERVER.DMSCLOUD_BASEDATA}/dealerSaleInfo/deleteAuthorizedBrand/${orgRelationId}`);
//新增
export const addSaleInfoMaintain = params => axios.post(`${SERVER.DMSCLOUD_BASEDATA}/dealerSaleInfo/addSaleInfoMaintain`,  params );
//查询-所属经销商公司
export const getDistributor = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/dealerSaleInfo/getDistributor`);
//查询-所属经销商公司售后
export const getDistributors = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/dealerSaleInfo/getDistributors`);
//查询所有所属经销商公司
export const getDistributorALL = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/dealerSaleInfo/getDistributorALL`);

//新增授权品牌
export const addAuthorizedBrand = params => axios.post(`${SERVER.DMSCLOUD_BASEDATA}/dealerSaleInfo/addAuthorizedBrand`,  params );
//查询品牌
export const getBrandList = params => axios.get(`${SERVER.DMSCLOUD_SYSBASEDATA}/api/brand/carbrand/carbrandList`);
//查询车系
export const getSeriesList = brandId => axios.get(`${SERVER.DMSCLOUD_SYSBASEDATA}/series/carserialList?brandId=${brandId}`);
//编辑保存
export const updateSaleInfo = (params,id) => axios.put(`${SERVER.DMSCLOUD_BASEDATA}/dealerSaleInfo/updateSaleInfo/${id}`,  params );

//查询-授权品牌
export const queryAuthorizedById = id => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/dealerSaleInfo/queryAuthorizedById`);

//所属区域
export const getMerge = id => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/company/org/getMerge`);

//所属区域--大区小区
export const getOrgByOrgType = (orgType) => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/org/getOrgByOrgType?orgType=${orgType}`);


